import svar
import numpy as np
import cv2
import time

rtmv=svar.load('svar_rtmv')

options={"ip":"/home/hanpc/projects/activities/xinda_materials/detection/python/out.rtmv","port":1025,"skip":1}

dataset=rtmv.DatasetNetwork(options)

while True:
  fr=dataset.grabFrame()
  if fr == None:
    break

  print(fr.id(),fr.timestamp(),fr.getImage(0,0),fr.getHeight2Ground(),fr.getGPSLLA(),fr.getPitchYawRoll())

  image=fr.getImage(0,0)
  
  m= np.array(image)
  m.dtype='uint8'
  print(m.shape,m.dtype.name) # BGRA

  #cv2.imshow('video', m)
  #cv2.waitKey(5)
  #time.sleep(0.1)


